home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / tut-code.lha / tut-code / button1 / main.c < prev   
C/C++ Source or Header  |  1992-01-02  |  767b  |  41 lines

  1. #include <IV-look/kit.h>
  2. #include <InterViews/background.h>
  3. #include <InterViews/place.h>
  4. #include <InterViews/session.h>
  5. #include <InterViews/style.h>
  6. #include <InterViews/window.h>
  7. #include <stdio.h>
  8.  
  9. class App {
  10. public:
  11.     void msg();
  12. };
  13.  
  14. declare(ActionCallback,App)
  15. implement(ActionCallback,App)
  16.  
  17. void App::msg() {
  18.     printf("hi mom!\n");
  19. }
  20.  
  21. int main(int argc, char** argv) {
  22.     Session* session = new Session("Himom", argc, argv);
  23.     Style* style = session->style();
  24.     Kit* kit = Kit::instance();
  25.     App* a = new App;
  26.     session->run_window(
  27.     new ApplicationWindow(
  28.         new Background(
  29.         new Margin(
  30.             kit->simple_push_button(
  31.             "Push me", style,
  32.             new ActionCallback(App)(a, &App::msg)
  33.             ),
  34.             10.0
  35.         ),
  36.         style->flat()
  37.         )
  38.     )
  39.     );
  40. }
  41.